# 静态方法：就是放在类里面的函数
class C:

    @staticmethod
    def func():
        print("I love FishC")


c = C()
# 可以通过对象返回
c.func()
# 也可以通过类名返回
C.func()

print("================================================================================" * 3)


# 类方法的用例
class Counter:
    count = 0

    def __init__(self):
        Counter.count += 1

    @staticmethod
    def get_count():
        print(F"Counter类一共实例化了{Counter.count}个对象。")


c1 = Counter()
c2 = Counter()
c3 = Counter()
c1.get_count()
c2.get_count()
c3.get_count()
